feat: initial scaffolding for the google-cloud-spanner-dbapi-driver package#16121
feat: initial scaffolding for the google-cloud-spanner-dbapi-driver package#16121
google-cloud-spanner-dbapi-driver package#16121Conversation
… package, including core files, tests, documentation, and build configurations.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational structure for a new Python DBAPI 2.0 compliant driver for Google Cloud Spanner. It introduces the necessary directory layout, core module files, and initial configurations for development, testing, and documentation. The changes prepare the repository for the implementation of the actual Spanner DBAPI driver logic. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request sets up the initial scaffolding for the google-cloud-spanner-dbapi-driver package. The changes are mostly boilerplate and configuration files. My review focuses on ensuring consistency and correctness across these new files. I've pointed out a few inconsistencies in release status indicators across README.rst, setup.py, and .repo-metadata.json. I've also suggested improvements to the documentation build configuration in docs/conf.py to make it more robust, and a change in noxfile.py to prevent the coverage check from failing with placeholder tests. Overall, this is a good starting point for the new package.
| release = __version__ | ||
| # The short X.Y version. | ||
| version = ".".join(release.split(".")[0:2]) |
There was a problem hiding this comment.
The current method of setting release and version is based on a hardcoded empty __version__ string on line 42, which is fragile. A better approach is to import the version directly from the package. This ensures the documentation always reflects the correct version. Please also remove the __version__ = "" on line 42.
| release = __version__ | |
| # The short X.Y version. | |
| version = ".".join(release.split(".")[0:2]) | |
| import google.cloud.spanner_driver.version | |
| release = google.cloud.spanner_driver.version.__version__ | |
| # The short X.Y version. | |
| version = ".".join(release.split(".")[0:2]) |
| .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg | ||
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels |
There was a problem hiding this comment.
The release_level in .repo-metadata.json is set to preview, but this badge indicates a stable release. To maintain consistency, this should be updated to a preview badge.
| .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg | |
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels | |
| .. |stable| image:: https://img.shields.io/badge/support-preview-orange.svg | |
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels |
| .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg | ||
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels |
There was a problem hiding this comment.
The release_level in .repo-metadata.json is set to preview, but this badge indicates a stable release. To maintain consistency, this should be updated to a preview badge.
| .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg | |
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels | |
| .. |stable| image:: https://img.shields.io/badge/support-preview-orange.svg | |
| :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels |
| root_doc = "index" | ||
|
|
||
| # General information about the project. | ||
| project = "google-cloud-spanner-dbapi" |
| test runs (not system test runs), and then erases coverage data. | ||
| """ | ||
| session.install("coverage", "pytest-cov") | ||
| session.run("coverage", "report", "--show-missing", "--fail-under=100") |
There was a problem hiding this comment.
With the current placeholder tests, code coverage is 0%. The cover session will therefore fail due to --fail-under=100. It's better to set this to 0 for the initial scaffolding and add a TODO to increase it as tests are added.
| session.run("coverage", "report", "--show-missing", "--fail-under=100") | |
| session.run("coverage", "report", "--show-missing", "--fail-under=0") # TODO: Increase this as tests are added. |
| assert len(version_candidates) == 1 | ||
| version = version_candidates[0] | ||
|
|
||
| release_status = "Development Status :: 1 - Planning" |
There was a problem hiding this comment.
The release status "Development Status :: 1 - Planning" is inconsistent with the release_level: "preview" in .repo-metadata.json. For a "preview" release, "Development Status :: 3 - Alpha" would be more appropriate.
| release_status = "Development Status :: 1 - Planning" | |
| release_status = "Development Status :: 3 - Alpha" |
initial scaffolding for the
google-cloud-spanner-dbapi-driverpackage, including core files, tests, documentation, and build configurations.Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #16120 🦕